#include-once
#include <WinAPI.au3>
#include <WinAPIConstants.au3>
#include <APISysConstants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPISys.au3>
#include <WindowsConstants.au3>
#include 'Debugging.au3'
#include 'GUIs\MainWindow.au3'

Opt('GUIOnEventMode', 1)
GUIRegisterMsg($WM_ERASEBKGND, 'WmEraseBkgnd')
__Run(MainWindow_Create()))

Func __Run($hWnd)
	If ($hWnd = 0) Then Error('ERROR_MAIN_WINDOW_CREATION_FAILED')
	GUISwitch($hWnd)

	_WinAPI_ShowWindow($hWnd, @SW_SHOW)
	_WinAPI_InvalidateRect($hWnd, 0, True)


	While True
		Sleep(0x7FFFFFFF)
	WEnd
EndFunc


